<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <a v-bind:href="url" @click='handle'>百度</a>
    <!-- v-bind 动态绑定属性 简写方式 :href -->
    <a :href="url" @click='handle1'>传智</a>
    <a :href="url" @click='handle2'>qq</a>
  </div>
  <script src="../vue.js"></script>
  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        url: ''
      },
      methods: {
        handle() {
          this.url = 'http://www.baidu.com'
        },
        handle2() {
          this.url = 'https://im.qq.com/'
        },
        handle1() {
          this.url = 'http://itcast.cn'
        }
      }
    })
  </script>
</body>

</html>